//
//  YJCPCWebView.m
//  YJB
//
//  Created by 高卫明 on 16/7/19.
//  Copyright © 2016年 YJB. All rights reserved.
//

#import "YJCPCWebView.h"

@interface YJCPCWebView ()<WKNavigationDelegate,WKUIDelegate>
{
     NSURL       *_wkwebViewURL;
}

@end

@implementation YJCPCWebView

- (void)viewDidLoad
{
    [super viewDidLoad];
    
    if (self.urlStr) {
        //网页
        _wkwebViewURL = [NSURL URLWithString:_urlStr];
        self.title = self.navTitle;
        NSURLRequest *request = [NSURLRequest requestWithURL:
                                 _wkwebViewURL];
         [self.bitWkwebview loadRequest:request];
    }
    else
    {
    //网页
    _wkwebViewURL = [NSURL URLWithString:@"www.a8vsc.com"];
    NSURLRequest *request = [NSURLRequest requestWithURL:
                             _wkwebViewURL];
    [self.bitWkwebview loadRequest:request];
    }
}

- (WKWebView *)bitWkwebview
{
    if (!_CPCWkwebview)
    {
        _CPCWkwebview = [[WKWebView alloc] initWithFrame:
                         CGRectMake(0,0 ,IPHONE_W , IPHONE_H - 64)];
        _CPCWkwebview.navigationDelegate = self;
        [self.view addSubview:_CPCWkwebview];
    }
    return _CPCWkwebview;
}

- (void)dealloc
{
    MyLog(@"****************");
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
